﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB.ExtensibleStorage;
using YJKInspectModelFunc.ModelLayer;

namespace YJKSparseDisOfDoor.ModelLayer
{
	public class ResultBean
	{
		public BaseDoorPacker StartDoor { get; set; }

		public BaseDoorPacker EndDoor { get; set; }

		public double Distance { get; set; }

		public string RoomName { get; set; }

		public string FloorName { get; set; }

		public ResultBean(BaseDoorPacker startDoor, BaseDoorPacker endDoor, string roomName, string floorName, double dis)
		{
			this.StartDoor = startDoor;
			this.EndDoor = endDoor;
			this.Distance = dis;
			this.RoomName = roomName;
			this.FloorName = floorName;
		}

		public bool IfTrust()
		{
			List<string> list;
			if (this.StartDoor.UseRevitLinkInstance != null)
			{
				Entity entity;
				Utility.TryGetAddedValue(this.StartDoor.UseRevitLinkInstance, out list, out entity);
			}
			else
			{
				Entity entity;
				Utility.TryGetAddedValue(this.StartDoor.ThisDoor, out list, out entity);
			}
			DoorSchema doorSchema = new DoorSchema(this.StartDoor.ThisDoor.Id, this.EndDoor.ThisDoor.Id, this.Distance);
			return list.Contains(doorSchema.ThisValue);
		}
	}
}
